package com.joolun.web.api.forumtype.service.impl;


import com.joolun.common.utils.DateUtils;
import com.joolun.web.api.forumtype.domain.ForumType;
import com.joolun.web.api.forumtype.mapper.ForumTypeMapper;
import com.joolun.web.api.forumtype.service.IForumTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 帖子分区配置Service业务层处理
 * 
 * @author joolun
 * @date 2025-04-12
 */
@Service
public class ForumTypeServiceImpl implements IForumTypeService
{
    @Autowired
    private ForumTypeMapper forumTypeMapper;

    /**
     * 查询帖子分区配置
     * 
     * @param id 帖子分区配置主键
     * @return 帖子分区配置
     */
    @Override
    public ForumType selectForumTypeById(Long id)
    {
        return forumTypeMapper.selectForumTypeById(id);
    }

    /**
     * 查询帖子分区配置列表
     * 
     * @param forumType 帖子分区配置
     * @return 帖子分区配置
     */
    @Override
    public List<ForumType> selectForumTypeList(ForumType forumType)
    {
        return forumTypeMapper.selectForumTypeList(forumType);
    }

    /**
     * 新增帖子分区配置
     * 
     * @param forumType 帖子分区配置
     * @return 结果
     */
    @Override
    public int insertForumType(ForumType forumType)
    {
        forumType.setCreateTime(DateUtils.getNowDate());
        return forumTypeMapper.insertForumType(forumType);
    }

    /**
     * 修改帖子分区配置
     * 
     * @param forumType 帖子分区配置
     * @return 结果
     */
    @Override
    public int updateForumType(ForumType forumType)
    {
        forumType.setUpdateTime(DateUtils.getNowDate());
        return forumTypeMapper.updateForumType(forumType);
    }

    /**
     * 批量删除帖子分区配置
     * 
     * @param ids 需要删除的帖子分区配置主键
     * @return 结果
     */
    @Override
    public int deleteForumTypeByIds(Long[] ids)
    {
        return forumTypeMapper.deleteForumTypeByIds(ids);
    }

    /**
     * 删除帖子分区配置信息
     * 
     * @param id 帖子分区配置主键
     * @return 结果
     */
    @Override
    public int deleteForumTypeById(Long id)
    {
        return forumTypeMapper.deleteForumTypeById(id);
    }
}
